/**
 * 
 */
package edu.cmu.cs.webapp.ioms.views;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.part.ViewPart;

import edu.cmu.cs.webapp.ioms.utils.IOMSConstants;

/**
 * @author Christian
 * 
 */
public class UsersPanelView extends ViewPart {
	public static final String ID_VIEW = "edu.cmu.cs.webapp.ioms.views.userpanel";
	private Text loginTxt;
	private Text initPwdTxt;

	private Text nameTxt;
	private Combo roleComb;
	private Text departmentTxt;

	/**
	 * 
	 */
	public UsersPanelView() {
		// TODO Auto-generated constructor stub
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets
	 * .Composite)
	 */
	@Override
	public void createPartControl(Composite parent) {
		Composite container = new Composite(parent, SWT.NULL);
		GridLayout layout = new GridLayout();
		container.setLayout(layout);

		layout.numColumns = 3;
		// layout.verticalSpacing = 9;

		Label label = new Label(container, SWT.NULL);

		/* id */
		label.setText("Login*:"); //$NON-NLS-1$

		loginTxt = new Text(container, SWT.BORDER | SWT.SINGLE);

		GridData gd = new GridData(GridData.FILL_HORIZONTAL);
		gd.horizontalSpan = 2;
		// _memberIDTxt.setEditable(false);
		loginTxt.setLayoutData(gd);

		// initial password
		label = new Label(container, SWT.NULL);
		label.setText("Initial Password*:"); //$NON-NLS-1$
		initPwdTxt = new Text(container, SWT.BORDER | SWT.PASSWORD);
		gd = new GridData(GridData.FILL_HORIZONTAL);
		gd.horizontalSpan = 2;
		initPwdTxt.setLayoutData(gd);

		// name
		label = new Label(container, SWT.NULL);
		label.setText("Name*:"); //$NON-NLS-1$
		nameTxt = new Text(container, SWT.BORDER);
		gd = new GridData(GridData.FILL_HORIZONTAL);
		gd.horizontalSpan = 2;
		nameTxt.setLayoutData(gd);

		// role
		label = new Label(container, SWT.NULL);
		label.setText("Role*:"); //$NON-NLS-1$
		roleComb = new Combo(container, SWT.BORDER);
		roleComb.setItems(IOMSConstants.USER_ROLES);
		gd = new GridData(GridData.FILL_HORIZONTAL);
		gd.horizontalSpan = 2;
		roleComb.setLayoutData(gd);

		// department
		label = new Label(container, SWT.NULL);
		label.setText("Department:"); //$NON-NLS-1$

		departmentTxt = new Text(container, SWT.BORDER | SWT.SINGLE);
		gd = new GridData(GridData.FILL_HORIZONTAL);
		gd.horizontalSpan = 2;
		departmentTxt.setLayoutData(gd);

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
	 */
	@Override
	public void setFocus() {
		// TODO Auto-generated method stub

	}

}
